﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;

namespace Mdsd.Cpoe.DataAccess
{
    public class DataContext : DbContext
    {
        public DataContext()
            : base("name=docare")
        {
            base.Database.Log = Console.Write;
        }
    
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            
            //取消级联删除功能
            modelBuilder.Conventions.Remove<OneToManyCascadeDeleteConvention>();
            //取消复数命名
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
           
            base.OnModelCreating(modelBuilder);
        }
      
    }
}
